home *** CD-ROM | disk | FTP | other *** search
- <!--- This view-only example illustrates usage
- of StructCount. --->
- <P>This file is similar to addemployee.cfm, which is called
- by StructNew, StructClear, and StructDelete. To test this file,
- copy the StructCount function to the appropriate place
- in addemployee.cfm.
- <P>
- To run this snippet
- under UNIX, you must add employee ID generation logic.
- <!---
- <cfswitch expression="#ThisTag.ExecutionMode#">
- <cfcase value="start">
- <CFIF StructIsEmpty(attributes.EMPINFO)>
- <CFOUTPUT>Error. No employee data was passed.</cfoutput>
- <CFEXIT METHOD="ExitTag">
- <cfelse>
- <CFQUERY NAME="AddEmployee" DATASOURCE="cfsnippets">
- INSERT INTO Employees(FirstName, LastName, Email, Phone, Department)
- VALUES
- <CFOUTPUT>
- (
- '#StructFind(attributes.EMPINFO, "firstname")#' ,
- '#StructFind(attributes.EMPINFO, "lastname")#' ,
- '#StructFind(attributes.EMPINFO, "email")#' ,
- '#StructFind(attributes.EMPINFO, "phone")#' ,
- '#StructFind(attributes.EMPINFO, "department")#'
- )
- </cfoutput>
- </cfquery>
- </cfif>
- <CFOUTPUT><HR>Employee Add Complete
- <P>#StructCount(attributes.EMPINFO)# columns added.</cfoutput>
- </cfcase>
- </cfswitch> --->
-
-